import { Client } from "../client/Client";
import { Snowflake } from "./utils/Snowflake";
import { RoleDto } from "./dto/Role";

export class Role {
    version!: number
    // unicode_emoji: null,
    // tags: {},
    position!: number
    permissions!: string
    name!: string
    mentionable!: boolean
    managed!: boolean
    id!: Snowflake
    icon?: string | null
    hoist!: boolean
    flags!: number
    color!: number

    constructor(private client: Client, data: RoleDto) {
        this._patch(data);
    }

    private _patch(data: RoleDto) {

        
        // console.log("Role " + JSON.stringify(data) )


        this.id = data.id;
        this.name = data.name;
        this.version = data.version;
        this.position = data.position;
        this.permissions = data.permissions;
        this.mentionable = data.mentionable;
        this.managed = data.managed;
        this.icon = data.icon;
        this.hoist = data.hoist;
        this.flags = data.flags;
        this.color = data.color;
    }
}